from selenium.webdriver.edge.service import Service
from selenium import webdriver
import time
# 使用 Service 类指定驱动路径，双反斜杠避免转义
service = Service("D:\\Driver\\msedgedriver.exe")
driver = webdriver.Edge(service=service)

driver.get("https://www.baidu.com")
time.sleep(2)
